package com.factors.TangChuan.Internet_Access;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

public class ExamScoreFilterDriver {

    public static void main(String[] args) throws Exception {

        Configuration conf = new Configuration();
        Job job = Job.getInstance(conf, "Exam Score Filter");
        job.setJarByClass(ExamScoreFilterDriver.class);

        job.setMapperClass(ExamScoreFilterMapper.class);
        job.setReducerClass(ExamScoreFilterReducer.class);

        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(IntWritable.class);

        FileInputFormat.addInputPath(job, new Path("Data/part-m-00000"));
        FileOutputFormat.setOutputPath(job, new Path("output/Tang/Internet_Access"));

        System.exit(job.waitForCompletion(true) ? 0 : 1);
    }
}